clear all

*********Set working directory and load data
local user: env USERNAME
if "`user'" == "ENTERYOURNAME"  cd "SETYOURDIRECTORY"
else if "`user'" == "sagomm"  cd "C:\Users\sagomm\Dropbox\SEP-Trust\Analysis\" 

use "Data\w9_conjoint.dta"

******Install necesarry user-written commands
do "Scripts\functions\function_conjoint.do"
do "Scripts\functions\function_addplot.do"

**** Figure 2: Conjoint Actor Attribute ****
loc cj_cond actor year reporting monitoring regulation sanction
loc xlab 0.35(.05).65

*MEM of Attributes
conjoint choice actor year reporting monitoring regulation sanction, est(mm) id(PubId)
mat overall = e(results)

*Save n and degress of freedom
loc obs1=e(N)
loc obs:di %7.0fc `obs1'
loc n1=e(N_clust)
loc n:di %6.0fc `n1'
loc df1=e(df_r)
loc df:di %6.0fc `df1'

coefplot ///
	(matrix(overall[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))), ///
	title("Actors involved in policy process", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
				Parliament = "Parliament" ///
				Experts  = "Experts" ///
				NGOs = "NGOs" ///
				Sector = "Sector" ///
				Sector_and_Parl_ = `""Sector" "and Parl.""' ///
				Sector__NGOs__Exp_ = `""Sector" "NGOs and Exp.""' ///
				All_actors = `""Sector, NGOs" "Parliament, Exp.""', ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector = ///
				`"{bf: Single Actor}"' ///
		    Sector_and_Parl_ ///
			Sector__NGOs__Exp_  ///
			All_actors = ///
			`"{bf: Multiple Actors}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	legend(off) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	graphregion(color(white)) ///
	name(marg_means_actor, replace) 
	
graph export "Plots\Figure2a_conjoint_actors.png", as(png) name("marg_means_actor") replace	
	
	
******Supplementary Information: Figure Full Conjoint******
loc cj_cond actor year reporting monitoring regulation sanction
loc xlab 0.35(.05).65


*MEM of Attributes
conjoint choice actor year reporting monitoring regulation sanction, est(mm) id(PubId)
mat overall = e(results)

*Save n and degress of freedom
loc obs1=e(N)
loc obs:di %7.0fc `obs1'
loc n1=e(N_clust)
loc n:di %6.0fc `n1'
loc df1=e(df_r)
loc df:di %6.0fc `df1'

*create panel A
coefplot ///
	(matrix(overall[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(overall[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))), ///
	title("Policy process", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
				Parliament = "Parliament" ///
				Experts  = "Experts" ///
				NGOs = "NGOs" ///
				Sector = "Sector" ///
				Sector_and_Parl_ = `""Sector" "and Parl.""' ///
				Sector__NGOs__Exp_ = `""Sector" "NGOs and Exp.""' ///
				All_actors = `""All" "actors""' ///
				_2023 = "2023" ///
				_2024 = "2024" ///
				_2025 = "2025" ///
				_2026 = "2026" ///
				_2027 = "2027" ///
				_2028 = "2028", ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl ///
				Sector_NGOs_Parl ///
				All_actors = ///
			`"{bf: Actors involved}"' ///
		        _2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028 =  ///
			`"{bf:Year of implementation}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	legend(off) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:A)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means1, replace) 
	
	
*create panel B
coefplot ///
	(matrix(overall[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(overall[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(overall[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(overall[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))), ///
	title("Policy design", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
		No_conditions = `""No" "Conditions""' ///
		Some_conditions   = `""Some" "Conditions""'  ///
		Many_conditions  = `""Many" "Conditions""' ///
		By_noone = `""By" "Noone""' ///
		By_ngos = `""By" "NGOs""' ///
		By_admin = `""By" "Federal Admin.""' ///
		By_experts = `""By" "Experts""' ///
		By_experts__ngos = `""By" "Exp./NGOs""' ///
		By_admin__experts__ngos = `""By" "Admin./Exp./NGOs""' ///
		No_rules = `""No" "Rules""'  ///
		By_2040  = `""By" "2040""'  ///
		By_2035  = `""By" "2035""'  ///
		By_2030  = `""By" "2030""'  ///
		No_Sanction = `""No" "Sanction""'  ///
		Moderate_Sanction = `""Moderate" "Sanction""'  ///
		Severe_Sanction  = `""Severe" "Sanction""', ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions = ///
			`"{bf:Reporting}"' ///
		By_noone ///
				By_admin ///
				By_experts ///
				By_ngos ///
				By_experts__ngos ///
				By_admin__experts__ngos = ///
			`"{bf:Monitoring}"' ///
			No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030 = ///
			`"{bf:Regulation}"' ///
		No_rules ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction = ///
			`"{bf:Sanction}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	legend(off) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:B)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means2, replace) 
	
gr combine ///
	marg_means1 ///
	marg_means2, row(1) ///
	note("Error bars represent 95% confidence intervals (df=`df') from `n' respondents * 5 choices for n=`obs' observations", ///
	s(tiny) pos(7)) ///
	graphregion(color(white)) ///
	name(fig_1, replace)

//Save Figure Appendix
graph export "Plots\SI_Chapter2_conjoint_full.png", as(png) name("fig_1") replace




******Conjoint by overall trust: high and low******
loc cj_cond actor year reporting monitoring regulation sanction
loc xlab 0.35(.05).65


*MEM of Attributes
conjoint choice actor year reporting monitoring regulation sanction if trust3 == 3, est(mm) id(PubId)
mat overall_3 = e(results)

conjoint choice actor year reporting monitoring regulation sanction if trust3 == 1, est(mm) id(PubId)
mat overall_1 = e(results)

*Save n and degress of freedom
loc obs1=e(N)
loc obs:di %7.0fc `obs1'
loc n1=e(N_clust)
loc n:di %6.0fc `n1'
loc df1=e(df_r)
loc df:di %6.0fc `df1'

*create panel A
coefplot ///
	(matrix(overall_3[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(overall_3[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m (O) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(overall_1[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(Oh) mc(midgreen) ///
			ci((5 6)) ciopts(lc(midgreen))) ///
	(matrix(overall_1[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m(Oh) mc(sienna) ///
		    ci((5 6)) ciopts(lc(sienna))), ///
	title("Policy process", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
				Parliament = "Parliament" ///
				Experts  = "Experts" ///
				NGOs = "NGOs" ///
				Sector = "Sector" ///
				Sector_and_Parl_ = `""Sector" "and Parl.""' ///
				Sector__NGOs__Exp_ = `""Sector" "NGOs and Exp.""' ///
				All_actors = `""All" "actors""' ///
				_2023 = "2023" ///
				_2024 = "2024" ///
				_2025 = "2025" ///
				_2026 = "2026" ///
				_2027 = "2027" ///
				_2028 = "2028", ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl ///
				Sector_NGOs_Parl ///
				All_actors = ///
			`"{bf: Actors involved}"' ///
		        _2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028 =  ///
			`"{bf:Year of implementation}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	legend(off) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:A)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means1, replace) 
	
	
*create panel B
coefplot ///
	(matrix(overall_3[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(overall_3[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(O) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(overall_3[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(O) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(overall_3[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(O) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
(matrix(overall_1[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(Oh) mc(midgreen) ///
			ci((5 6)) ciopts(lc(midgreen))) ///
	(matrix(overall_1[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(Oh) mc(sandb) ///
			ci((5 6)) ciopts(lc(sandb))) ///
	(matrix(overall_1[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(Oh) mc(eltgreen) ///
			ci((5 6)) ciopts(lc(eltgreen))) ///
	(matrix(overall_1[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(Oh) mc(sienna) ///
			ci((5 6)) ciopts(lc(sienna))), ///
	title("Policy design", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
		No_conditions = `""No" "Conditions""' ///
		Some_conditions   = `""Some" "Conditions""'  ///
		Many_conditions  = `""Many" "Conditions""' ///
		By_noone = `""By" "Noone""' ///
		By_ngos = `""By" "NGOs""' ///
		By_admin = `""By" "Federal Admin.""' ///
		By_experts = `""By" "Experts""' ///
		By_experts__ngos = `""By" "Exp./NGOs""' ///
		By_admin__experts__ngos = `""By" "Admin./Exp./NGOs""' ///
		No_rules = `""No" "Rules""'  ///
		By_2040  = `""By" "2040""'  ///
		By_2035  = `""By" "2035""'  ///
		By_2030  = `""By" "2030""'  ///
		No_Sanction = `""No" "Sanction""'  ///
		Moderate_Sanction = `""Moderate" "Sanction""'  ///
		Severe_Sanction  = `""Severe" "Sanction""', ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions = ///
			`"{bf:Reporting}"' ///
		By_noone ///
				By_admin ///
				By_experts ///
				By_ngos ///
				By_experts__ngos ///
				By_admin__experts__ngos = ///
			`"{bf:Monitoring}"' ///
			No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030 = ///
			`"{bf:Regulation}"' ///
		No_rules ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction = ///
			`"{bf:Sanction}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	legend(off) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:B)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means2, replace) 
	
gr combine ///
	marg_means1 ///
	marg_means2, row(1) ///
	note("Filled circles represent respondents with high overal trust scores, hollow circles respondents with low overall trust scores. ", ///
	s(tiny) pos(7)) ///
	graphregion(color(white)) ///
	name(fig_1c, replace)

//Save Figure
graph export "Plots\SI_Chapter2_conjoint_bytrust.png", as(png) name("fig_1c") replace


******************************************************
******          Conjoint by sector              ******
******************************************************

loc cj_cond actor year reporting monitoring regulation sanction
loc xlab 0.35(.05).65

*MEM of Attributes
conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "agriculture", est(mm) id(PubId)
mat agri = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "finance", est(mm) id(PubId)
mat fin = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "mobility", est(mm) id(PubId)
mat mob = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "plastic", est(mm) id(PubId)
mat plas = e(results)

*Save n and degress of freedom
loc obs1=e(N)
loc obs:di %7.0fc `obs1'
loc n1=e(N_clust)
loc n:di %6.0fc `n1'
loc df1=e(df_r)
loc df:di %6.0fc `df1'

*create panel A
coefplot ///
	(matrix(agri[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(agri[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m (O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(fin[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(fin[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m(Dh) mc(edkblue) ///
		    ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(mob[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(mob[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m (T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(plas[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(plas[,1]), ///
			keep( ///
				_2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028) ///
			m(Sh) mc(sand) ///
		    ci((5 6)) ciopts(lc(sand))), ///
	title("Policy process", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
				Parliament = "Parliament" ///
				Experts  = "Experts" ///
				NGOs = "NGOs" ///
				Sector = "Sector" ///
				Sector_and_Parl_ = `""Sector" "and Parl.""' ///
				Sector__NGOs__Exp_ = `""Sector" "NGOs and Exp.""' ///
				All_actors = `""All" "actors""' ///
				_2023 = "2023" ///
				_2024 = "2024" ///
				_2025 = "2025" ///
				_2026 = "2026" ///
				_2027 = "2027" ///
				_2028 = "2028", ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl ///
				Sector_NGOs_Parl ///
				All_actors = ///
			`"{bf: Actors involved}"' ///
		        _2023 ///
				_2024 ///
				_2025 ///
				_2026 ///
				_2027 ///
				_2028 =  ///
			`"{bf:Year of implementation}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:A)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means1, replace) 
	
	
*create panel B
coefplot ///
	(matrix(agri[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(agri[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(agri[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(agri[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green))) ///
	(matrix(fin[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(fin[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(fin[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(fin[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(mob[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(mob[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(mob[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(mob[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(plas[,1]), ///
			keep( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(plas[,1]), ///
			keep( ///
				By_noone ///
				By_ngos ///
				By_admin ///
				By_experts ///
				By_experts__ngos ///
				By_admin__experts__ngos) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(plas[,1]), ///
			keep( ///
				No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))) ///
	(matrix(plas[,1]), ///
			keep( ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))), ///
	title("Policy design", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
		No_conditions = `""No" "Conditions""' ///
		Some_conditions   = `""Some" "Conditions""'  ///
		Many_conditions  = `""Many" "Conditions""' ///
		By_noone = `""By" "Noone""' ///
		By_ngos = `""By" "NGOs""' ///
		By_admin = `""By" "Federal Admin.""' ///
		By_experts = `""By" "Experts""' ///
		By_experts__ngos = `""By" "Exp./NGOs""' ///
		By_admin__experts__ngos = `""By" "Admin./Exp./NGOs""' ///
		No_rules = `""No" "Rules""'  ///
		By_2040  = `""By" "2040""'  ///
		By_2035  = `""By" "2035""'  ///
		By_2030  = `""By" "2030""'  ///
		No_Sanction = `""No" "Sanction""'  ///
		Moderate_Sanction = `""Moderate" "Sanction""'  ///
		Severe_Sanction  = `""Severe" "Sanction""', ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				No_conditions ///
				Some_conditions ///
				Many_conditions = ///
			`"{bf:Reporting}"' ///
		By_noone ///
				By_admin ///
				By_experts ///
				By_ngos ///
				By_experts__ngos ///
				By_admin__experts__ngos = ///
			`"{bf:Monitoring}"' ///
			No_rules ///
				By_2040 ///
				By_2035 ///
				By_2030 = ///
			`"{bf:Regulation}"' ///
		No_rules ///
				No_Sanction ///
				Moderate_Sanction ///
				Severe_Sanction = ///
			`"{bf:Sanction}"', ///
		ang(90) labs(small)) ///
	leg(off) /// 
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	byopts(row(1)) ///
	note("{bf:B)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means2, replace) 
	
gr combine ///
	marg_means1 ///
	marg_means2, row(1) ///
	graphregion(color(white)) ///
	name(fig_1c, replace)

//Save Figure 
graph export "Plots\SI_Chapter2_conjoint_bysector.png", as(png) name("fig_1c") replace


************************************************
*By Sector but only first attribute: actors ****
************************************************

loc cj_cond actor year reporting monitoring regulation sanction
loc xlab 0.35(.05).65

*MEM of Attributes
conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "agriculture", est(mm) id(PubId)
mat agri = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "finance", est(mm) id(PubId)
mat fin = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "mobility", est(mm) id(PubId)
mat mob = e(results)

conjoint choice actor year reporting monitoring regulation sanction if w9_treat_conj_cost == "plastic", est(mm) id(PubId)
mat plas = e(results)

*Save n and degress of freedom
loc obs1=e(N)
loc obs:di %7.0fc `obs1'
loc n1=e(N_clust)
loc n:di %6.0fc `n1'
loc df1=e(df_r)
loc df:di %6.0fc `df1'

*create panel 
coefplot ///
	(matrix(agri[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(O) mc(forest_green) ///
			ci((5 6)) ciopts(lc(forest_green)))  ///
	(matrix(fin[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(Dh) mc(edkblue) ///
			ci((5 6)) ciopts(lc(edkblue))) ///
	(matrix(mob[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(T) mc(maroon) ///
			ci((5 6)) ciopts(lc(maroon))) ///
	(matrix(plas[,1]), ///
			keep( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl_ ///
				Sector__NGOs__Exp_ ///
				All_actors) ///
			m(Sh) mc(sand) ///
			ci((5 6)) ciopts(lc(sand))), ///
	title("Actors involved in policy process", bex box bc(gs14) lc(black) lp(solid) bm(small)) ///
	xti("Pr(Selecting Proposal)") level(95) msize(small) ///
	coefl( ///
				Parliament = "Parliament" ///
				Experts  = "Experts" ///
				NGOs = "NGOs" ///
				Sector = "Sector" ///
				Sector_and_Parl_ = `""Sector" "and Parl.""' ///
				Sector__NGOs__Exp_ = `""Sector" "NGOs and Exp.""' ///
				All_actors = `""All" "actors""', ///
		labs(vsmall)  glc(white)) ///
			groups( ///
				Parliament ///
				Experts ///
				NGOs ///
				Sector ///
				Sector_and_Parl ///
				Sector_NGOs_Parl ///
				All_actors = ///
			`"{bf: Actors involved}"', ///
		ang(90) labs(small)) ///
	xlabel("`xlab'", format(%3.2f) nogrid) ///
	xlabel(,labsize(small)) ///
	xline(0.50, lp(shortdash) lc(gs5)) ///
	legend( ///
	pos(6) size(small) row(1) ///
	label(2 "Agriculture") label(4 "Financial Sector") label (6 "Mobility Sector") label (8 "Industry & Commerce")) ///
	byopts(row(1)) ///
	note("{bf:A)}", pos(10) ring(12) size(small)) ///
	graphregion(color(white)) ///
	name(marg_means3, replace) 
	
//Save Figure 
graph export "Plots\Chapter2_conjoint_actors_bysector.png", as(png) name("marg_means3") replace